gtkbox: remove unnecessary queue_compute_expand()
authorChristoph Reiter <reiter.christoph@gmail.com>
Tue, 26 Jul 2016 11:09:21 +0000 (13:09 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 1 Aug 2016 13:02:04 +0000 (09:02 -0400)
The expand child property does not have any effect on the
expand state of the GtkBox, so queuing a compute_expand
when changing it is not needed.

https://bugzilla.gnome.org/show_bug.cgi?id=769162

gtk/gtkbox.c

index 93206cf403f1c0f251aa21cd0e24db212860e88e..e39eb495a56d50d9d1bb257033d60504d4a23c89 100644 (file)
@@ -2540,17 +2540,11 @@ gtk_box_set_child_packing (GtkBox      *box,
   gtk_widget_freeze_child_notify (child);
   if (list)
     {
-      gboolean expanded;
+      expand = expand != FALSE;
 
-      expanded = expand != FALSE;
-
-      /* avoid setting expand if unchanged, since queue_compute_expand
-       * can be expensive-ish
-       */
-      if (child_info->expand != expanded)
+      if (child_info->expand != expand)
         {
-          child_info->expand = expand != FALSE;
-          gtk_widget_queue_compute_expand (GTK_WIDGET (box));
+          child_info->expand = expand;
           gtk_container_child_notify_by_pspec (GTK_CONTAINER (box), child, child_props[CHILD_PROP_EXPAND]);
         }